﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A_Day_at_the_Races
{
    public class Bet
    {
        public Guy Bettor { set; get; } // The guy who placed the bet
        public int Amount { set; get; } // The amount of the cash that was bet
        public int Dog { set; get; } // The number of the dog the bet is on

        public string GetDescription()
        {
            string description = String.Format("{0} bets {1} on dog #{2}", Bettor.Name, Amount,Dog);
            // Return a string that says who placed the bet, how much
            // cash was bet, and which dog he bet on ("Joe bets 8 on dog #4")
            // If the amount is zero, no bet was placed ("Joe hasn't placed a bet")
            return description;
        }
        public int PayOut(int winner)
        {
            // The parameter is the winner of the race. If the dog won,
            // return the amount bet. Otherwise, return the negative of amount bet
            if (Dog == winner)
                return Amount;
            return -Amount;
        }
       
    }
}
